package cn.itsource.pethome.basic.controller;

import cn.itsource.pethome.basic.service.IVerificationCodeService;
import cn.itsource.pethome.basic.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @description: 描述:
 * @date: 2020/8/14 19:03
 * @author: summer
 * version: 1.0
 */
@RestController
@RequestMapping("/user")
public class VerificationCodeController {

    /**验证码相关的service*/
    @Autowired
    private IVerificationCodeService verificationCodeService;

    /**
     * 功能描述: 发送手机验证码 验证
     * @param partm 手机号码
     * @return: cn.itsource.pethome.basic.util.AjaxResult
     * @Date: 2020/8/15
     */
    @RequestMapping("/sendPhoneCode")
    public AjaxResult sendPhoneCode(@RequestBody Map<String,String> partm){
        //手机号码
        String phone = partm.get("phone");
       //发送手机对应的验证码
        return verificationCodeService.sendPhoneCode(phone);
    }
}
